package com.mdms.hibernate;


import com.mdms.interfaces.orm.CrudDAO;
import com.mdms.interfaces.orm.DAOFactory;
import com.mdms.interfaces.orm.MetaDAO;

public class DAOFactoryHibernate extends DAOFactory {

	@Override
	public CrudDAO getCrudDAO() {
		String methodName = "getCrudDAO";
		try {
			return instantiateDAO(CrudDaoHibernate.class);
		} catch (Exception ex) {
			throw new RuntimeException("Can not get CrudDAO: " + CrudDAO.class, ex);
		}
	}
	
	private CrudDAO instantiateDAO(Class daoClass) {
		String methodName = "instantiateDAO";
		try {
			
			CrudDaoHibernate dao = (CrudDaoHibernate)daoClass.newInstance();
			return dao;
		} catch (Exception ex) {
			throw new RuntimeException("Cannot instantiate DAO: " + daoClass, ex);
		} finally {

		}
	}

	@Override
	public MetaDAO getMetaDAO() {
		// TODO Auto-generated method stub
		return null;
	}


}
